Ext.define('Seq.data.proxy.Cell', {
    extend: 'Seq.data.proxy.API',
    alias: 'proxy.cell',

    reader: {
        type: 'json',
        rootProperty: 'data',
        transform: {
            fn(data) {
                if (false == data.success) { // 服务器报错时，必须返回空
                    Seq.Msg.error('服务器内部错误：<br/><br/>' + data.message);
                    return [];
                }
                let records = [], cells = data.data.cells || [], dims = data.data.dims;
                for (let cell of cells) {
                    for (let dim in dims) {
                        Ext.apply(cell, dims[dim][cell[dim]])
                    }
                    records.push(cell);
                }
                return records;
            },
            scope: this
        }
    }
});